﻿
@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <link href="~/Content/Css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="~/Content/Css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <link href="~/Content/Css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
    <link href="~/Content/Css/animate.css" rel="stylesheet">
    <link href="~/Content/Css/style.css?v=4.1.0" rel="stylesheet">

    <title>签约操作</title>
    <style>
    </style>
</head>
<body>
    <div class="col-md-12">
        <form class="form-horizontal m-t" id="mainForm">
            <input type="hidden" id="Id" name="Id" value=@Request.QueryString["id"].ToString()>

            <div style="height:30px"></div>
            <div class="form-group">
                <label class="col-xs-3 control-label" style="text-align:right;">首付工程款日期：</label>
                <div class="col-xs-9">
                    <input type="text" class="form-control inp" style="width:200px;" id="DownPaymentTime" name="DownPaymentTime" readonly="readonly" value="@DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss")">
                </div>
            </div>
            <div class="form-group">
                <label class="col-xs-3 control-label" style="text-align:right;">首期工程款金额：</label>
                <div class="col-xs-9">
                    <input type="number" name="DownPaymentMoney" id="DownPaymentMoney" class="form-control" />
                </div>
            </div>
            <div class="form-group">
                <label class="col-xs-3 control-label" style="text-align:right;">首期工程款备注：</label>
                <div class="col-xs-9">
                    <textarea name="DownPaymentRemark" id="DownPaymentRemark" class="form-control" rows="2"></textarea>
                </div>
            </div>
            <div class="col-sm-6">
            </div>
            <div class="col-sm-6">
                <div class="pull-right">
                    <button id="submit" class="btn btn-primary pull-center" type="submit">
                        <i class="fa fa-check"></i>&nbsp;提&nbsp;交
                    </button>
                </div>
            </div>

        </form>


    </div>
    <!-- 全局js -->
    <script type="text/javascript" src="~/Scripts/jquery.min.js?v=2.1.4"></script>
    <script type="text/javascript" src="~/Scripts/bootstrap.min.js?v=3.3.6"></script>

    <!-- jQuery Validation plugin javascript-->
    <script type="text/javascript" src="~/Scripts/plugins/validate/jquery.validate.min.js"></script>
    <script type="text/javascript" src="~/Scripts/plugins/validate/messages_zh.min.js"></script>
    <script type="text/javascript" src="~/Scripts/Extensions/ExtValidator.js"></script>

    <!-- layer javascript -->
    <script type="text/javascript" src="~/Scripts/plugins/layer/layer.min.js"></script>
    <script src="~/Scripts/plugins/layer/laydate/laydate.js"></script>
    <script>
        laydate({
            elem: '#DownPaymentTime',
            format: 'YYYY-MM-DD', // 分隔符可以任意定义，该例子表示只显示年月
            festival: true, //显示节日
            max: '2099-01-01 00:00:00', //设定最小日期为当前日期
            min: '2010-01-01 00:00:00', //最大日期
            choose: function (datas) { //选择日期完毕的回调
            }
        });

        $(function () {
            // validate signup form on keyup and submit
            var icon = "<i class='fa fa-times-circle'></i> ";
            var validator = $("#mainForm").validate({
                submitHandler: function (form) {
                    //进行ajax传值
                    $.ajax({
                        url: "/Decoration/DecorationRunnings/FirstProjectMoneyOperate",
                        type: "post",
                        dataType: "json",
                        data: $('#mainForm').serialize(),
                        success: function (data) {
                            //Info,Success,Warning,Error
                            var type = data.type;
                            if (type == 1) {
                                layer.msg(data.content, { icon: 6, time: 2000 },
                                    function () {
                                        var index = parent.layer.getFrameIndex(window.name);
                                        parent.layer.close(index);
                                    });

                            } else {
                                layer.msg(data.content, { icon: 5, time: 2000 });
                            }
                        }
                    });
                }
            });
        });
    </script>
</body>
</html>
